<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>用户登录</title>
  <!-- import CSS -->
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
  <style>
    [v-cloak] {
      display: none;
    }
  </style>
</head>
<body>
<div v-cloak id="app">
  <el-card style="max-width: 50rem; margin: auto;">
    <h2 slot="header">
      <a href="/oauth/authorize?grant_type=authorization_code&response_type=code&client_id=loyal&redirect_uri=http://baidu.com&state=123">
        授权码模式
      </a>
    </h2>
    <el-form action="/login" method="post">
      <el-form-item>
        <el-input type="text" name="username" value="admin" placeholder="用户名"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input type="password" name="password" value="111111" placeholder="密码"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" native-type="submit">
          登录授权
        </el-button>
      </el-form-item>
    </el-form>
  </el-card>
  <el-card style="max-width: 50rem; margin: auto;">
    <h2 slot="header">
      密码模式
    </h2>
    <el-form action="/oauth/token" method="post">
      <el-form-item>
        <el-input type="text" name="username" value="admin" placeholder="用户名"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input type="password" name="password" value="111111" placeholder="密码"></el-input>
        <input type="hidden" name="client_id" value="loyal">
        <input type="hidden" name="client_secret" value="111111">
        <input type="hidden" name="grant_type" value="password">
      </el-form-item>
      <el-form-item>
        <el-button type="primary" native-type="submit">
          获取token
        </el-button>
      </el-form-item>
    </el-form>
  </el-card>
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
  new Vue({
    el: '#app',
    data: function () {
      return {visible: false}
    }
  })
</script>
</html>